import axios from 'axios';

export interface DataType {
    id: number;
    userId: string;
    createTime: string;
    history: string;
}

export async function fetchData(): Promise<DataType[]> {
    try {
        const response = await axios.post('http://localhost:8080/api/train/page');
        return response.data.content;
    } catch (error) {
        console.error('Error fetching data:', error);
        return [];
    }
}